package org.example.com.pattern.create.singleton

class Singleton private constructor() {
    companion object {
        private var instance: Singleton? = null
        fun getInstance(): Singleton {
            return instance ?: synchronized(Singleton::class.java) {
                instance ?: Singleton()
            }.run {
                instance = this
                instance!!
            }
        }
    }
}